package day10;

import java.io.*;
import java.net.Socket;
import java.util.Scanner;
public class WeatherTest {
    public static void main(String[] args) {
        Scanner input =new Scanner(System.in);
        try {
            Socket socket =new Socket("localhost",8888);
            InputStream in =socket.getInputStream();
            OutputStream out =socket.getOutputStream();
            BufferedReader br =new BufferedReader(new InputStreamReader(in));
            PrintWriter pw =new PrintWriter(out,true);
            System.out.println(br.readLine());
            String str =input.next();
            pw.println(str);
            String str1 =null;
            while((str1 =br.readLine()).equals("退出成功！欢迎下次登录!")==false){
                System.out.println(str1);
                System.out.println(br.readLine());
                str =input.next();
                pw.println(str);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
